﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;


namespace ScotiabankWP7.Forms.Login
{
    public partial class InicioSesion : PhoneApplicationPage
    {
        public InicioSesion()
        {
            InitializeComponent();
            this.listPickerTarjetas.ItemsSource = GetTarjetas();
            this.listPickerTarjetas.SelectedIndex = 0;
        }

        private IList<string> GetTarjetas()
        {
            List<string> items = new List<string>();
            items.Add("Débito ScotiaCard");
            items.Add("Acceso y Débito Maestro");
            items.Add("Visa Electrón");
            return items;
        }

        private void ContentPanel_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                String tarjeta = (String)PhoneApplicationService.Current.State["tarjetaSelec"];
                if (tarjeta != null)
                {
                    //button1.Content = tarjeta;
                }
            }
            catch (Exception ex)
            {
            }
            tbTarjeta.Focus();
        }


        private void bIngresar_Click(object sender, RoutedEventArgs e)
        {
            PhoneApplicationFrame root = Application.Current.RootVisual as PhoneApplicationFrame;
            root.Navigate(new Uri("/Forms/Login/Credenciales.xaml", UriKind.Relative));
            //root.Navigate(new Uri("/Forms/SeleccionaPagoPendiente.xaml", UriKind.Relative));
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            PhoneApplicationFrame root = Application.Current.RootVisual as PhoneApplicationFrame;
            root.Navigate(new Uri("/Forms/Login/TiposTarjeta.xaml", UriKind.Relative));
        }
    }
}